<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'addReader.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
body{
font-size:12px;
}
div{
	width:500px;
	height:500px;
	
}
table{
	margin-left:50px;
	font-size:13px;
}
select{
width:156px;
}
.bt{
width:80px;
margin-left:60px;
margin-top:30px;
}
td{
height:45px;
text-align:left;
}

</style>
  
  </head>
  
  <body>
  <div>
    <form action="jsp/user/readeradd_list">
    <table>
     <tr>
    <td>读者姓名：</td>
    <td><input type='text' name='rname' id="rname" /></td>
    <td id="showrname"></td>
    </tr>
  
  <tr>
    <td>身份证：</td>
    <td><input type='text' name='rcard' id="rcard"/></td>
        <td id="showrcard"></td>
    </tr>
    <tr>
    <td>联系地址：</td>
    <td><input type='text' name='raddr'/></td>
    </tr>
    
     <tr>
    <td>电话号码：</td>
    <td><input type='text' name='rtel'/></td>
    </tr>
    <tr>
    <td>账号押金：</td>
    <td><input type='text' name='rmoney'/></td>
    </tr>
    
    <tr>
    <td>开户时间：</td>
    <td><input type='text' name='rtime' onclick="new Calendar().show(this);" readonly="readonly" /></td>
    </tr>
    
    <tr>
    <td> 开户管理员：</td>
    <td><input type='text' name='uuser' value="${ sessionScope.username}"/></td>
    </tr>
    </table>
    
  <input  type='submit' value='提交' class="bt" id="btn"/>
  <input  type='reset' value='重置' class="bt"/>
  </form>
  </div>
  </body>
  <script type="text/javascript" src="js/calendar.js"></script>
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
  $("#btn").attr("disabled", true);
   $("#rname").blur(function(){
  var obj={};
  	obj.username=$("#rname").val();
  	obj.userpsd=$(this).val();
  	if($(this).val()==""||$.trim($(this).val()).length==0){
  	$('#showrname').text("请输入读者姓名").css("color","red");
  		  $("#btn").attr("disabled", true);
   }
  	else{
  	  	$('#showrname').text("OK").css("color","green");
  	 if($('#showrcard').text()=="OK")
  	 $("#btn").attr("disabled", false);
  	}  
   });
   
     $("#rcard").blur(function(){
  	if($(this).val()==""||$.trim($(this).val()).length==0){
  	$('#showrcard').text("请输入读者卡号").css("color","red");
  		  $("#btn").attr("disabled", true);
   }
  	else{
  	$('#showrcard').text("OK").css("color","green");
 		if($('#showrname').text()=="OK")
  			 $("#btn").attr("disabled", false);
  	}  
   });
      });
  </script>
</html>
